<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改称号')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-title-edit" th:object="${fantasyTitle}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">称号类型：</label>
                <div class="col-sm-8">
                    <select id="typeId" name="typeId" class="form-control">
                        <option th:each="type:${titleTypes}" th:alt-title="${type.describe}" th:value="${type.id}"
                                th:text="${type.typeName}" th:selected="${fantasyTitle.typeId == type.id}" value="1">
                            aaa
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">称号名称：</label>
                <div class="col-sm-8">
                    <input name="title" th:field="*{title}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">称号描述：</label>
                <div class="col-sm-8">
                    <textarea id="describe" name="describe" th:field="*{describe}" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">级别：</label>
                <div class="col-sm-8">
                    <input name="level" th:field="*{level}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">高级称号：</label>
                <div class="col-sm-8">
                    <input name="seniorId" th:field="*{seniorId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">等级要求：</label>
                <div class="col-sm-8">
                    <input name="levelMin" th:field="*{levelMin}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">其他要求：</label>
                <div class="col-sm-8">
                    <input name="otherRequirement" th:field="*{otherRequirement}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "fantasy/fantasyTitle";
        $("#form-title-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-title-edit').serialize());
            }
        }
    </script>
</body>
</html>